<!DOCTYPE html>
<html lang="en">

<head>
    <title>今日股票动态</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="res/layui/css/layui.css" />
    <style type="text/css">
        .body {
            font-size: 15px;
        }

        .zhang {
            color: #f00;
            font-weight: bolder;
        }

        .die {
            color: #090;
            font-weight: bolder;
        }

        .ml15 {
            margin-left: 15px;
        }

        .ml20 {
            margin-left: 20px;
        }

        .mr15 {
            margin-right: 15px;
        }

        .mr20 {
            margin-right: 20px;
        }

        .ml100 {
            margin-left: 100px;
        }

        .ml60 {
            margin-left: 60px;
        }

        .fs20 {
            font-size: 20px;
        }

        .fs15 {
            font-size: 15px;
        }
    </style>
</head>

<body class="body">
    <div class="layui-fluid">
        <div class="layui-row">
            <div class="layui-col-md8">
                <div class="layui-collapse">
                    <div class="layui-colla-item">
                        <h2 class="layui-colla-title">今日股票<span style="float: right;" id="currentTime"></span></h2>

                        <div class="layui-colla-content layui-show">
                            <blockquote class="layui-elem-quote"><span>今日盈亏: </span><span id="currentPrice"
                                    class="ml15 fs20">0</span><span class="ml60">总盈亏:</span> <span id="totalPrice"
                                    class="ml15 fs20">0</span>
                            </blockquote>
                            <blockquote class="layui-elem-quote" id="dapanView">
                                测试
                            </blockquote>
                            <table id="gpTable" lay-filter="gpTable"></table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-md4">
                <div class="layui-collapse">
                    <div class="layui-colla-item">
                        <h2 class="layui-colla-title">添加股票</h2>
                        <div class="layui-colla-content layui-show">
                            <form class="layui-form" action="" lay-filter="submit_form">
                                <div class="layui-form-item">
                                    <label class="layui-form-label"></label>
                                    <div class="layui-input-block">
                                        <input type="text" name="keyword" lay-verify="required" autocomplete="off"
                                            class="layui-input" placeholder="股票代码/名称/简拼/关键字" />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">选择股票</label>
                                    <div class="layui-input-block">
                                        <select name="gp_list" lay-filter="search_gp">
                                            <option value="">选择股票</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">代码</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="code" lay-verify="required" autocomplete="off"
                                            class="layui-input" readonly="readonly" />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">名称</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="name" lay-verify="required" autocomplete="off"
                                            class="layui-input" readonly="readonly" />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">持仓成本</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="costPrice" lay-verify="number" autocomplete="off"
                                            class="layui-input" value="0" />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">持仓数量</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="number" lay-verify="number" autocomplete="off"
                                            class="layui-input" value="0" />
                                        <input type="hidden" name="mktNum" value="" />
                                        <input type="hidden" name="type" value="" />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button type="submit" class="layui-btn" lay-submit=""
                                            lay-filter="submit_gp">提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script id="dpTemplate" type="text/html">
        {{#  layui.each(d.list, function(index, item){ }}
            {{# var clsName =item.change>=0 ? 'zhang': 'die'; }}
            <span>{{ item.name }}:</span>
            <span class="ml15 mr15 fs20 {{clsName}}">{{ item.price }} <span class="fs15">{{ item.change }}</span></span>
        {{#  }); }}
        {{#  if(d.list.length === 0){ }}
          <span>暂无数据</span>
        {{#  } }} 
      </script>
    <script type="text/javascript" src="res/layui/layui.js"></script>
    <script type="text/javascript">
        layui.config({
            dir: '/res/layui/' //layui.js 所在路径（注意，如果是 script 单独引入 layui.js，无需设定该参数。），一般情况下可以无视
            , version: false //一般用于更新模块缓存，默认不开启。设为 true 即让浏览器不缓存。也可以设为一个固定的值，如：201610
            , debug: false //用于开启调试模式，默认 false，如果设为 true，则JS模块的节点会保留在页面
            , base: '/res/js/' //设定扩展的 layui 模块的所在目录，一般用于外部模块扩展
        });

        layui.use(['form', 'gp'], function () {
            layui.gp();
        });
    </script>
</body>

</html>